<template>
  <div>
    <!-- 面包屑 -->
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/welcome' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item><a href="/">活动管理</a></el-breadcrumb-item>
      <el-breadcrumb-item>活动列表</el-breadcrumb-item>
      <el-breadcrumb-item>活动详情</el-breadcrumb-item>
    </el-breadcrumb>

    <!-- 卡片 -->
    <el-card class="box-card">
      <el-table :data="list" border style="width: 100%">
        <el-table-column prop="id" label="#"> </el-table-column>
        <el-table-column prop="authName" label="权限名称"> </el-table-column>
        <el-table-column prop="path" label="路径"> </el-table-column>
        <el-table-column prop="level" label="权限等级">
           <template slot-scope="props">
              <el-tag type="primary" v-if="props.row.level==0">一级</el-tag>
              <el-tag type="success" v-if="props.row.level==1">二级</el-tag>
              <el-tag type="warning" v-if="props.row.level==2">三级</el-tag>
           </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { getRolesRight } from "../../api/juse";
export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.getList();
  },
  methods: {
    async getList() {
      let res = await getRolesRight("list");
      console.log(res, "resRights");
      this.list = res.data;
    },
  },
};
</script>

<style scoped>
.box-card {
  margin-top: 20px;
}
</style>